Skip to content

fix(replication): log audit send failures#154

Merged
jacderida merged 1 commit into
mainfrom
audit-timeout-diagnostics
Jun 21, 2026
Merged

fix(replication): log audit send failures#154
jacderida merged 1 commit into
mainfrom
audit-timeout-diagnostics

Conversation

@dirvine

@dirvine dirvine commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add source-side WARN diagnostics when responsible-chunk audit challenge send_request fails before an AuditResponse
  • include ES/search-friendly fields in both tracing fields and message text: audit type/phase/outcome, challenged peer, challenge id, key count, configured timeout, elapsed time, first challenged key prefix, encoded length, and bounded send error class
  • keep the existing final audit failure ERROR/trust semantics unchanged; raw transport error is debug-only to avoid WARN-level cardinality/secrecy risk

Why

reason=Timeout currently hides whether an audit challenge failed due to a request deadline, peer/channel unavailability, connection/dial failure, transport error, or another send_request error. This patch gives production enough detail to correlate timeout spikes without changing protocol or penalty behaviour.

Review

Full review team was used before opening:

  • hypothesis/design review: confirmed reason=Timeout on this path is a send_request Err catch-all and recommended source-side diagnostics
  • observability review: confirmed the fields are useful for ES and recommended keeping the final ERROR stable
  • security/cardinality review: requested removing raw send_error from WARN fields; addressed by moving it to debug-only and keeping bounded send_error_class at WARN
  • build/Rust review: no blockers on ownership/tracing syntax/semantics

Verification

  • cargo fmt --all -- --check
  • cargo test -p ant-node classify_audit_send_error_uses_bounded_classes
  • cargo test -p ant-node first_challenged_key_label
  • git diff --check
  • cargo clippy -p ant-node --all-targets --all-features -- -D warnings

Copilot AI review requested due to automatic review settings June 21, 2026 20:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds source-side diagnostics for audit challenge send_request failures in the replication audit path, improving observability of “Timeout” outcomes without changing protocol/trust semantics.

Changes:

  • Adds structured WARN logging (plus debug-only raw error) when an audit challenge fails before receiving an AuditResponse.
  • Introduces helper functions to (a) label the first challenged key with a stable prefix and (b) classify send errors into bounded classes for log safety.
  • Adds unit tests for the new helper functions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/replication/audit.rs Outdated
Comment thread src/replication/audit.rs
@dirvine dirvine force-pushed the audit-timeout-diagnostics branch from 3f0ee3d to 4f838a9 Compare June 21, 2026 20:41
@jacderida jacderida merged commit 562b086 into main Jun 21, 2026
12 checks passed
@jacderida jacderida deleted the audit-timeout-diagnostics branch June 21, 2026 21:21
jacderida added a commit to grumbach/ant-node that referenced this pull request Jun 22, 2026
Patch release on top of v0.13.0. Only change since v0.13.0 is PR WithAutonomi#154
(fix(replication): log audit send failures) — extended audit-timeout
diagnostics logging.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
grumbach pushed a commit to grumbach/ant-node that referenced this pull request Jun 30, 2026
Minor release on top of v0.13.0. Notable change since v0.13.0 is PR WithAutonomi#128
(Gossip-triggered subtree audit + responsible-chunk audit, ADR-0002),
which carries breaking changes — hence the minor bump rather than 0.13.1.
Also includes WithAutonomi#154, WithAutonomi#157 (audit logging) and WithAutonomi#124 (CI ADR governance).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants